﻿/// <reference path="../../../knockout-2.1.0.js" />
/// <reference path="../Common.js" />

$(document).ready(function () {
  setSubCategories();
});

function setSubCategories() {
  var request = $.ajax({
    url: '/Admin/SubCategories/GetSubCategories',
    data: { categoryId: $('#categoryId').val() },
    dataType: 'json',
    type: 'GET',
    async: false
  });

  request.done(function (data) {
    debugger;
    // bind list
    //ko.applyBindings(new CategoriesViewModel(data), $('#categories')[0]);
    // todo
  });

  request.fail(function (jqXhr, textStatus) {
    whenRequestFailed(jqXhr, textStatus);
  });
}
